Allocation Functions

The following functions are used to set or inspect the (maximum) number of pages for each type class, for contiguous blocks, or for relocatable blocks.



allocate type number[Function]

Sets the maximum number of pages for the type class of the implementation type type to number. If more than number pages have already been allocated, an error is signalled.

allocated-pages type[Function]

Returns the number of pages currently allocated for the type class of the implementation type type.

maximum-allocatable-pages type[Function]

Returns the current maximum number of pages for type class of the implementation type type.

allocate-contiguous-pages number[Function]

Sets the maximum number of pages for contiguous blocks to number.

allocated-contiguous-pages[Function]

Returns the number of pages allocated for contiguous blocks.

maximum-contiguous-pages[Function]

Returns the current maximum number of pages for contiguous blocks.

allocate-relocatable-pages number[Function]

Sets the maximum number of pages for relocatable blocks to number. The relocatable area is expanded to number pages immediately. Therefore,``the current maximum number'' and ``the number of pages allocated'' have the same meanings for relocatable blocks.

allocated-relocatable-pages[Function]

Returns the number of pages allocated for relocatable blocks.

If the pages for a particular type class are exhausted after the maximum number of pages for that class have been allocated, and if there remain no free cells (actually, if there remain very few cells), KCL behaves as directed by the value of the KCL specific variable *ignore-maximum-pages*. If the value is nil, then KCL signals a correctable error and enters the break loop. The user can reset the maximum number by calling allocate and then continue the execution of the program by typing :r.



Example:

        >(make-list 100000)

        Correctable error: The storage for CONS is exhausted.
                           Currently, 531 pages are allocated.
                           Use ALLOCATE to expand the space.
        Signalled by MAKE-LIST.

        Broken at FUNCALL.
        >>(ALLOCATE 'CONS 1000)
        t

        >>:r

        (nil nil nil nil nil nil nil nil nil nil ............

The user can also reset the maximum number of pages for relocatable blocks and for contiguous blocks in a similar manner. On the other hand, if the value of *ignore-maximum-pages* is non- nil, then KCL automatically increments the maximum number of pages for the class by 50 percent. The initial value of *ignore-maximum-pages* is t.